package com.paw.distribute.session.controller;

import javax.servlet.http.HttpServletRequest;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author lvzihai
 * @date 2021/6/17
 **/
@Slf4j
@RestController
public class TokenController {

  @GetMapping("/getToken")
  public String getToken(HttpServletRequest request){
    String sessionId = request.getSession().getId();
    log.info("sessionId: {}",sessionId);

    return sessionId;
  }
}
